* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1e88e5;
}

h2 {
    margin: 15px 0;
    color: #1e88e5;
    border-bottom: 1px solid #e1e1e1;
    padding-bottom: 8px;
    font-size: 18px;
}

h3 {
    margin: 15px 0;
    color: #333;
}

.settings-panel {
    background: linear-gradient(to bottom, #ffffff, #f9f9f9);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #eaeaea;
    width: 100%;
    transition: all 0.3s ease;
}

.settings-panel:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.inline-form {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
}

.form-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 150px;
}

.form-item label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 4px;
}

.form-item select {
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 36px;
    width: 100%;
    transition: all 0.3s ease;
    background: white;
}

.form-item select:hover {
    border-color: #40a9ff;
}

.form-item select:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
    outline: none;
}

.hint {
    margin-left: 10px;
    font-size: 12px;
    color: #888;
}

.btn {
    background: linear-gradient(to bottom, #1890ff, #096dd9);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    height: 36px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(24, 144, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    margin-top: 0;
}

.btn:hover {
    background: linear-gradient(to bottom, #40a9ff, #1890ff);
    box-shadow: 0 4px 8px rgba(24, 144, 255, 0.3);
    transform: translateY(-1px);
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    height: 60px;
}

.loading-progress {
    font-size: 16px;
    color: #1890ff;
    position: relative;
    padding-left: 24px;
}

.loading-progress:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    margin-top: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #1890ff;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.time-range-info {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.time-range-info p {
    font-size: 14px;
    color: #333;
}

.stats-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    width: 100%;
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
}

.stats-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.time-range-header {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.time-range-header div {
    font-size: 18px;
    font-weight: 500;
    color: #1890ff;
    text-align: center;
}

.statistics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.stat-item {
    padding: 10px 15px;
    background: #f9f9f9;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    border: 1px solid #eee;
    animation: fadeIn 0.5s ease-out;
    text-align: center;
}

.stat-item:hover {
    background: #f2f8ff;
    border-color: #d0e3ff;
}

.stat-item div {
    color: #555;
    font-size: 16px;
    text-align: center;
}

.stat-item span {
    font-weight: 600;
    color: #1890ff;
    font-size: 16px;
}

.continuous-data-section {
    display: flex;
    flex-wrap: wrap;
}

.continuous-up-section,
.continuous-down-section {
    width: 50%;
    padding: 10px;
    box-sizing: border-box;
    animation: fadeIn 0.5s ease-out;
}

.continuous-up-section h4,
.continuous-down-section h4 {
    margin: 0 0 10px 0;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 2px solid #1890ff;
    padding-bottom: 5px;
    color: #1890ff;
}

.continuous-up-section h4 {
    border-color: #14b143;
    color: #14b143;
}

.continuous-down-section h4 {
    border-color: #ef232a;
    color: #ef232a;
}

@media screen and (max-width: 768px) {
    .continuous-up-section,
    .continuous-down-section {
        width: 100%;
    }
    
    .statistics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-item {
        width: 100%;
    }
}

.continuous-data {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    position: relative;
    color: #666;
}

.tab-btn.active {
    color: #1890ff;
    font-weight: bold;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #1890ff;
}

.tab-content {
    padding: 15px 0;
}

.stat-table {
    width: 100%;
}

.stat-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-table th {
    background: linear-gradient(to bottom, #f8f9fa, #eaeaea);
    font-weight: 500;
    color: #444;
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
    font-size: 16px;
}

.stat-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #eee;
    color: #555;
    font-size: 16px;
}

.stat-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.stat-table tr:nth-child(odd) {
    background-color: #ffffff;
}

.stat-table tr:hover {
    background-color: #e6f7ff;
}

/* 连续次数列样式 */
.stat-table tr td:first-child {
    color: #333;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
}

/* 连续上涨数据样式 */
.continuous-up-section .stat-table tr td:last-child {
    color: #14b143;
    font-weight: 600;
    font-size: 16px;
}

/* 连续下跌数据样式 */
.continuous-down-section .stat-table tr td:last-child {
    color: #ef232a;
    font-weight: 600;
    font-size: 16px;
}

/* 各区域标题美化 */
.continuous-up-section h4, 
.continuous-down-section h4 {
    position: relative;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.7);
}

#klineContainer {
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
}

#klineContainer:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#kline-title {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 500;
    text-align: center;
    color: #1890ff;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.text-success {
    color: #4caf50;
}

.text-danger {
    color: #f44336;
}

@media screen and (max-width: 480px) {
    .statistics {
        grid-template-columns: 1fr;
    }
}

.custom-interval-container {
    margin-top: 5px;
}

.custom-interval-container label {
    margin-left: 5px;
    cursor: pointer;
}

.hint-box {
    margin-top: 16px;
}

.hint {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.hint-details {
    margin: 0 0 16px;
    padding-left: 20px;
    color: #666;
}

.hint-details li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.period-selection {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 10px;
}

.standard-period,
.custom-period {
    flex: 1;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.period-divider {
    display: flex;
    align-items: center;
    color: #6c757d;
    font-weight: 500;
    margin-top: 30px;
}

.period-select {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.hint-box {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.hint {
    color: #6c757d;
    margin-bottom: 10px;
}

.hint-details {
    margin: 0;
    padding-left: 20px;
}

.hint-details ul {
    padding-left: 20px;
    margin: 5px 0;
}

.hint-details li {
    margin: 5px 0;
    color: #495057;
}

input[type="radio"] {
    margin-right: 8px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 500;
}

.badge {
    background-color: #1e88e5;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.period-container {
    display: flex;
    align-items: center;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 0 4px;
    transition: all 0.3s ease;
}

.period-container:hover {
    border-color: #40a9ff;
    background: #fff;
}

.period-container select {
    border: none;
    background: transparent;
    min-width: 100px;
}

.period-container select:hover,
.period-container select:focus {
    border: none;
    box-shadow: none;
}

.help-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    color: #8c8c8c;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
    margin-left: 4px;
}

.help-btn:hover {
    background: #e6f7ff;
    color: #1890ff;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: block;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    border-radius: 50%;
}

.close:hover,
.close:focus {
    color: #333;
    background-color: #f0f0f0;
    text-decoration: none;
}

.expected-klines {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.expected-klines p {
    margin: 8px 0;
    color: #495057;
    font-size: 15px;
}

.expected-klines p:first-child {
    font-weight: 500;
    color: #1e88e5;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e9ecef;
}

.expected-klines p:nth-child(2) {
    font-weight: 500;
    color: #1e88e5;
    font-size: 16px;
}

.expected-klines p:nth-child(3) {
    color: #ff9800;
    font-weight: 500;
}

.expected-klines p:last-child {
    margin-top: 10px;
    color: #4caf50;
    font-weight: 500;
    font-size: 16px;
}

/* K线图卡片样式 */
.kline-cards {
    margin-top: 20px;
    padding: 20px;
}

.kline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kline-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

.kline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.kline-card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.kline-chart {
    width: 100%;
    height: 300px;
}

/* 涨跌颜色 */
.price-up {
    color: #26a69a;
}

.price-down {
    color: #ef5350;
}

/* 修改统计结果标题样式 */
.stats-container h2 {
    font-size: 16px;
    color: #1e88e5;
    margin: 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8e8;
}

/* 修改统计结果部分的样式，使其更紧凑 */
.continuous-data h3 {
    font-size: 14px;
    margin: 10px 0;
    color: #555;
}

/* 调整表格样式 */
.stat-table {
    margin-top: 10px;
}

.stat-table table {
    font-size: 12px;
    border-collapse: collapse;
    width: 100%;
}

/* 调整整体结果容器样式 */
#results {
    margin-top: 15px;
}

/* 使统计卡片更加紧凑 */
.statistics {
    gap: 10px;
    margin: 12px 0;
}

/* 调整标签页按钮样式 */
.tab-btn {
    padding: 6px 12px;
    font-size: 13px;
}

.time-range-title {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #ff0000;
}

.time-range-title h3 {
    font-size: 16px;
    margin: 0;
    color: #333;
    font-weight: 500;
}

.continuous-data-container {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #ff0000;
    display: flex;
    flex-wrap: wrap;
}

.continuous-up-section,
.continuous-down-section {
    width: 50%;
    padding: 10px;
    box-sizing: border-box;
}

.continuous-up-section h4,
.continuous-down-section h4 {
    margin: 0 0 15px 0;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    border-bottom: 2px solid #1890ff;
    padding-bottom: 5px;
    color: #1890ff;
}

@media screen and (max-width: 768px) {
    .continuous-up-section,
    .continuous-down-section {
        width: 100%;
    }
    
    .statistics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-item {
        width: 100%;
    }
}

/* 为上涨/下跌添加颜色 */
#upCandles {
    color: #14b143;
    font-weight: bold;
    font-size: 16px;
}

#downCandles {
    color: #ef232a;
    font-weight: bold;
    font-size: 16px;
}

#totalCandles, #flatCandles {
    color: #1890ff;
    font-weight: bold;
    font-size: 16px;
}

/* 美化数字显示 */
.stat-table tr td:last-child {
    font-family: 'Roboto Mono', 'Courier New', monospace;
    font-size: 16px;
}

/* 添加动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-item, .continuous-up-section, .continuous-down-section {
    animation: fadeIn 0.5s ease-out;
}

/* 不同统计项淡入时间错开 */
.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }
.stat-item:nth-child(4) { animation-delay: 0.4s; } 